<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

// Route::get('/', function () {
//     return view('index');
// });

//注册后跳转
Route::get('home', function () {
    return '登录成功<a href ="logout">点击退出</a>';
});
// Route::get('home', 'UserController@home');

//注册
Route::get('auth/register','UserController@getRegister');
// Route::post('auth/register',['middleware'=>'App\Http\Middleware\mail','uses'=>'UserController@postRegister']);
Route::post('auth/register','UserController@postRegister');

//登录
Route::get('auth/login','UserController@getLogin');
Route::post('auth/login','UserController@postLogin');

//退出
Route::get('auth/logout','UserController@getLogout');

//手动登录
Route::get('login','UserController@getlogin');
Route::post('login','UserController@postlogin');

//手动退出

Route::get('logout','UserController@logout');


//申请贷款
Route::get('jieqian','ProController@getjie');
Route::post('jieqian','ProController@postjie');

//审核项目列表
Route::get('shenhe','ProController@liebiao');

//贷款审核
Route::get('sh/{pid}','ProController@getshenhe');
Route::post('sh/{pid}','ProController@postshenhe');

//首页
Route::get('/','IndexController@index');

//投标表单
Route::get('touzi/{pid}','TouziController@gettouzi');
//记录投资信息
Route::post('touzi/{pid}','TouziController@posttouzi');


//实验邮件发送
Route::get('mail',function(){
	        $mail = new \Nette\Mail\Message;
        $mail->setFrom('lhnjxdqq@163.com')
            ->addTo('262264620@qq.com')
            ->setSubject('欢迎注册ddd')
            ->setBody("你好,这事了测试,没别的意思.");
        $mailer = new \Nette\Mail\SmtpMailer(array(
                'host' => 'smtp.163.com',
                'username' => 'lhnjxdqq',
                'password' => 'lhnjxdqq5488016',
        ));
        $mailer->send($mail);
});

//涨利
// Route::get('zhangli','TouziController@grow');

//个人中心
//我的贷款
Route::get('mydk','HomeController@mydk');

//我的投资
Route::get('mytz','HomeController@mytz');

//我的利润
Route::get('mylr','HomeController@mylr');

//我的账单
Route::get('myzd','HomeController@myzd');

//支付验证
Route::post('payyz','TouziController@tbyz');


//短信发送
Route::get('sms',function(){
    $aldy=new \Myclass\Aldy\AldySdk;
    $arr=['name'=>'xiling','val'=>'欢迎注册ddd','num'=>'1234567'];
    //短信签名,模板id,手机号,参数(数组形式传递)
    $rs=$aldy->sendsms('用户名验证','SMS_8981143','15210082143',$arr);
    var_dump($rs);
});
//发送短信验证码
Route::get('smscode/{mobile}','SmsController@send_sms');

//验证短信验证码

Route::get('yzsms/{code}','SmsController@yz_sms');